<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
                template="/WEB-INF/templates/mainLayout.xhtml">

    <ui:define name="mainContent">

        <div id="folderTopContent" class="folder-content" style="margin: 20px;">
            <div style="border-bottom: 1px solid #DDDDDD;">
                <p:graphicImage value="../../resources/img/icons/new-folder-2.png" height="55"/>
                <p:outputLabel value="Dosar nou" styleClass="table-label" style="font-size: 30px !important;"/>
            </div>

            <h:form>
                <div style="/*display: table-cell;*/">

                    <h:panelGrid styleClass="new-folder-panel" columns="3" columnClasses="column-1, column-2" rowClasses="row-style">

                        <p:outputLabel value="Nume:" for="lastName" styleClass="table-label"/>
                        <p:inputText id="lastName" value="#{folderBean.selectedFolder.lastName}" required="true" requiredMessage="Name is required"/>
                        <p:message for="lastName" />

                        <p:outputLabel value="Prenume:" for="firstName" styleClass="table-label"/>
                        <p:inputText id="firstName" value="#{folderBean.selectedFolder.firstName}" required="true" requiredMessage="Lastname is required"/>
                        <p:message for="firstName" />

                        <p:outputLabel value="Patronimic:" for="patronymic" styleClass="table-label"/>
                        <p:inputText id="patronymic" value="#{folderBean.selectedFolder.patronymic}" required="true" requiredMessage="Patronimyc is required"/>
                        <p:message for="patronymic" />

                        <p:outputLabel value="Data nasterii:" for="birth-date" styleClass="table-label"/>
                        <p:calendar id="birth-date" value="#{folderBean.selectedFolder.birthDate}" showOn="button" required="true" requiredMessage="Birth date is required"/>
                        <p:message for="birth-date" />

                        <p:outputLabel value="Codul IDNP:" for="idnp" styleClass="table-label"/>
                        <p:inputText id="idnp" value="#{folderBean.selectedFolder.IDNP}" required="true" requiredMessage="Cod IDNP is required"/>
                        <p:message for="idnp" />

                        <p:outputLabel value="Domiciliul:" for="residence-visa" styleClass="table-label"/>
                        <p:inputText id="residence-visa" value="#{folderBean.selectedFolder.residenceVisa}" required="true" requiredMessage="Residence visa is required"/>
                        <p:message for="residence-visa" />

                        <p:outputLabel value="Informatie de contact:" for="contact-info" styleClass="table-label"/>
                        <p:inputText id="contact-info" value="#{folderBean.selectedFolder.contactData}" required="true" requiredMessage="Contact info is required"/>
                        <p:message for="contact-info" />

                        <p:outputLabel value="Nationalitatea:" for="nationality" styleClass="table-label"/>
                        <p:selectOneMenu id="nationality" value="#{folderBean.selectedFolder.nationality}" required="true" requiredMessage="Nationality is required">
                            <f:selectItem itemLabel="Selectati nationalitatea" />
                            <f:selectItems value="#{applicationStateBean.nationalities}" var="n" itemLabel="#{n.name}" itemValue="#{n.id}" />
                        </p:selectOneMenu>
                        <p:message for="nationality" />

                        <p:outputLabel value="Sex:" for="sex" styleClass="table-label"/>
                        <p:selectOneRadio id="sex" value="#{folderBean.selectedFolder.sex}" required="true" requiredMessage="Sex is required">
                            <f:selectItem itemLabel="Male" itemValue="0"/>
                            <f:selectItem itemLabel="Female" itemValue="1"/>
                        </p:selectOneRadio>
                        <p:message for="sex" />

                        <p:outputLabel value="Starea familiala:" for="family-status" styleClass="table-label"/>
                        <p:selectOneMenu id="family-status" value="#{folderBean.selectedFolder.familyStatus}" required="true" requiredMessage="Family status is required">
                            <f:selectItem itemLabel="Selectati starea familiala" />
                            <f:selectItems value="#{applicationStateBean.familyStatuses}" var="fs" itemLabel="#{fs.name}" itemValue="#{fs.id}" />
                        </p:selectOneMenu>
                        <p:message for="family-status" />

                        <p:outputLabel value="Legitimatia:" for="card-id" styleClass="table-label"/>
                        <p:inputText id="card-id" value="#{folderBean.selectedFolder.cardID}" required="true" requiredMessage="Card ID is required"/>
                        <p:message for="card-id" />

                        <p:outputLabel value="Stampila:" for="stamp" styleClass="table-label"/>
                        <p:inputText id="stamp" value="#{folderBean.selectedFolder.stamp}" required="true" requiredMessage="Stamp no is required"/>
                        <p:message for="stamp" />

                        <p:outputLabel value="Membru sindicat:" styleClass="table-label"/>
                        <p:selectBooleanCheckbox id="syndicate-member" value="#{folderBean.selectedFolder.syndicateMember}" />
                        <h:outputText />

                    </h:panelGrid>
                </div>

                <div style="border-top: 1px solid #DDDDDD;text-align: right;padding: 10px;">
                    <p:commandButton value="Salveaza" icon="ui-icon-disk" action="#{folderBean.saveFolderData}" ajax="false" />
                    <p:commandLink value="Anuleaza" update="@form" process="@this" style="margin:5px;text-decoration: underline" />
                </div>
            </h:form>

        </div>

    </ui:define>

</ui:composition>